
  <template>
  <div style="padding: 10px;">
    <h3 class="wechat-detail-title">{{ detail.Title }}</h3>
    <div class="wechat-html" v-html="detail.Context"></div>
  </div>
</template>
    
    <script>
import { getDetailByID, getDetailByCategoryID } from '@/api/article'

export default {
  components: {},
  data() {
    return {
      detail: {},
    }
  },
  watch: {},
  created() {
    this.init()
  },
  methods: {
    async init() {
      if (this.$route.query.type) {
        const { data } = await getDetailByCategoryID({ categoryID: this.$route.query.id })
        this.detail = data
        console.log(data)
      } else {
        const { data } = await getDetailByID({ contextsID: this.$route.query.id })
        this.detail = data
        console.log(data)
      }
    },
  },
}
</script>
    
    <style>
@import './wechat.less';
</style>